-
Notifications
You must be signed in to change notification settings - Fork 1.5k
build(browser): integrate nx #16712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(browser): integrate nx #16712
Conversation
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16712 +/- ##
=======================================
Coverage 38.87% 38.87%
=======================================
Files 3420 3420
Lines 97313 97313
Branches 14625 14625
=======================================
Hits 37830 37830
Misses 57827 57827
Partials 1656 1656 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e36012a
to
1bca1d8
Compare
b76ebc6
to
8c6f822
Compare
8c6f822
to
6de9781
Compare
6de9781
to
6f82e4a
Compare
{ | ||
"extends": "./tsconfig.json", | ||
"include": ["src", "../../libs/common/src/autofill/constants"], | ||
"exclude": ["**/*.stories.*", "**/*.spec.ts"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this PR in particular I also added tsconfig.build.json
files that exclude stories from builds. Without this nx builds were failing due to some legitimate errors in the components project that aren't revealed by other builds. I don't condone this pattern in general, but didn't want to get distracted and decided to follow the pattern already established in the web vault with its tsconfig.build.json
files already committed here and here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addisonbeck We should create a follow-up ticket or contact the team responsible for those stories so that they can fix it and we can remove the this workaround
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-24802
📔 Objective
Enable Nx builds in the browser extension. For example:
Most complexity here is that we need to support the pre-nx build pipelines for a while, so we have to juggle both configurations. The recent refactor of our webpack config to a webpack config factory was pretty helpful here. I added some optional parameters that come from Nx in Nx builds. Most lines are just changes from relative paths to absolute paths to account for the fact that npm and nx have different working directories.
Once we update CI to use Nx builds exclusively, and the Nx builds have had time to get battle tested, we'll remove the old npm builds and this configuration will get much simpler.
Otherwise, this is a fairly straightforward port of the build commands from extension's package.json into a functioning project.json. It uses the standard executors and follows Nx conventions for this kind of build without much else that is special.
📸 Screenshots
running
npx nx test browser
running

npx nx lint browser
running

npx nx build browser --configuration=safari-commercial
*a running local chrome extension built with

npx nx serve browser
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes